const mapDeep = require('deepdash/mapDeep')

let res = mapDeep(
  [
    { name: 'something', good: false },
    {
      name: 'another thing', good: true,
      children: [
        { name: 'child thing 1', good: false },
        { name: 'child thing 2', good: true },
        { name: 'child thing 3', good: false },
      ],
    },
    {
      name: 'something else', good: true,
      subItem: { name: 'sub-item', good: false },
      subItem2: { name: 'sub-item-2', good: true },
    },
  ],
  (v, key, parent, context) => {
    const value = { ...v, paths: context.parents.map(item => item.name).concat(v.name).join('/') }
    return value
  },
  { leavesOnly: true, childrenPath: 'children', includeRoot: true }
);

console.log('map deep: ', res)
